/*
 * Copyright (c) gitee.com/jiandong001.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Helpers for building measure output value.
 */
export class YogaMeasureOutput {

  public static make(width: number, height: number): number { // loong
    return width << 32 | height;
  }

  public static getWidth(measureOutput: number): number {
    return 0xFFFFFFFF & (measureOutput >> 32);
  }

  public static getHeight(measureOutput: number): number {
    return 0xFFFFFFFF & measureOutput;
  }

//  public static long make(float width, float height) {
//    final int wBits = Float.floatToRawIntBits(width);
//    final int hBits = Float.floatToRawIntBits(height);
//    return ((long) wBits) << 32 | ((long) hBits);
//  }
//
//  public static long make(int width, int height) {
//    return make((float) width, (float) height);
//  }

//  public static getWidth(measureOutput: number): number { // loong
//    return Float.intBitsToFloat((number) (0xFFFFFFFF & (measureOutput >> 32)));
//  }
//
//  public static getHeight(long measureOutput: number): number { // loong
//    return Float.intBitsToFloat((number) (0xFFFFFFFF & measureOutput));
//  }
}
